<?php

namespace app\index\validate;

use app\index\model\User;
use think\Validate;

class Question extends Validate
{
    protected $rule = [
        'captcha' =>  'require|captcha',
        'cate_id' =>  'require',
        'title' =>  'require|min:10',
        'kiss' =>  'require|checkkiss',
        'content' =>  'require|min:10'
    ];

     protected $message  =   [

    ];

    public function checkkiss($kiss)
    {
    	$user = User::get(session('user_id'));

    	if($user->kiss<$kiss){
    		return "飞吻不够，请先充值！！";
    	}
    	return true;
    }
}
